Scenario #9313: Newly Created Account for Existing Natural Person Should Be Able to View Existing Memberships

Properties

Required

Given

name value
subjectName xyz-peter.smith

Expected

name value
expectedMembershipsJson [
  {
    “partner”: {
      “partnerNumber”: “P-10002”,
      “partnerRel”: {
        “type”: “PARTNER”,
        “anchor”: { “tradeName”: “Hostsharing eG” },
        “holder”: { “tradeName”: “Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.” },
        “contact”: { “emailAddresses”: { “main”: “contact-admin@secondcontact.example.com” } }
      },
      “details”: {
        “registrationOffice”: “Hamburg”,
        “registrationNumber”: “RegNo123456789”
      }
    },
    “memberNumber”: “M-1000202”,
    “memberNumberSuffix”: “02”,
    “validFrom”: “2022-10-01”,
    “validTo”: “2025-12-31”,
    “status”: “CANCELLED”,
    “membershipFeeBillable”: true
  }
]

personUuid

HTTP GET "/api/hs/accounts/accounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "242a0002-0000-0000-0000-000000000002", // Account: xyz-peter.smith
  "person" : {
    "uuid" : "acaf06bc-c81c-4ad6-9f13-4c65c824c7b3", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "subject" : {
    "uuid" : "242a0002-0000-0000-0000-000000000002", // Account: xyz-peter.smith
    "name" : "xyz-peter.smith",
    "organization" : "xyz",
    "type" : "USER"
  },
  "globalUid" : 21011,
  "globalGid" : 21011
} ]

Fetch the account for the current subject to resolve the related person.

Resolve partner trade name

HTTP GET "/api/hs/office/relations?relationType=REPRESENTATIVE&personUuid=acaf06bc-c81c-4ad6-9f13-4c65c824c7b3" // personUuid \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "d0fa0e48-47e0-4749-a9a6-f80403d877c0",
  "anchor" : {
    "uuid" : "ddbe26a0-9504-492d-b4f2-f5acf7052e94",
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "holder" : {
    "uuid" : "acaf06bc-c81c-4ad6-9f13-4c65c824c7b3", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "type" : "REPRESENTATIVE",
  "mark" : null,
  "contact" : {
    "uuid" : "89d7987a-6f0b-459e-afd9-a8bf81ec2048",
    "caption" : "second contact",
    "postalAddress" : {
      "country" : "Germany"
    },
    "emailAddresses" : {
      "main" : "contact-admin@secondcontact.example.com"
    },
    "phoneNumbers" : {
      "phone_office" : "+49 123 1234567"
    }
  }
} ]

Resolve partner UUID

HTTP GET "/api/hs/office/partners?name=Peter+Smith+-+The+Second+Hand+and+Thrift+Stores-n-Shipping+e.K." \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "a894e353-2b23-4286-ab07-fa53e91927e3",
  "partnerNumber" : "P-10002",
  "partnerRel" : {
    "uuid" : "d18c0d3c-43a5-411c-8c9c-48a189ad16bc",
    "anchor" : {
      "uuid" : "806e75fe-7894-4422-86be-783107f07f3f",
      "personType" : "LEGAL_PERSON",
      "tradeName" : "Hostsharing eG",
      "salutation" : null,
      "title" : null,
      "givenName" : null,
      "familyName" : null
    },
    "holder" : {
      "uuid" : "ddbe26a0-9504-492d-b4f2-f5acf7052e94",
      "personType" : "LEGAL_PERSON",
      "tradeName" : "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
      "salutation" : null,
      "title" : null,
      "givenName" : "Peter",
      "familyName" : "Smith"
    },
    "type" : "PARTNER",
    "mark" : null,
    "contact" : {
      "uuid" : "89d7987a-6f0b-459e-afd9-a8bf81ec2048",
      "caption" : "second contact",
      "postalAddress" : {
        "country" : "Germany"
      },
      "emailAddresses" : {
        "main" : "contact-admin@secondcontact.example.com"
      },
      "phoneNumbers" : {
        "phone_office" : "+49 123 1234567"
      }
    }
  },
  "details" : {
    "uuid" : "57781e0c-3ce2-42b6-a281-044de4f6e92a",
    "registrationOffice" : "Hamburg",
    "registrationNumber" : "RegNo123456789",
    "birthName" : null,
    "birthPlace" : null,
    "birthday" : null,
    "dateOfDeath" : null
  }
} ]

View their memberships

HTTP GET "/api/hs/office/memberships?partnerUuid=a894e353-2b23-4286-ab07-fa53e91927e3" // partnerUuid \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "f28e564d-4596-4065-9e33-796886727efa",
  "partner" : {
    "uuid" : "a894e353-2b23-4286-ab07-fa53e91927e3", // partnerUuid
    "partnerNumber" : "P-10002",
    "partnerRel" : {
      "uuid" : "d18c0d3c-43a5-411c-8c9c-48a189ad16bc",
      "anchor" : {
        "uuid" : "806e75fe-7894-4422-86be-783107f07f3f",
        "personType" : "LEGAL_PERSON",
        "tradeName" : "Hostsharing eG",
        "salutation" : null,
        "title" : null,
        "givenName" : null,
        "familyName" : null
      },
      "holder" : {
        "uuid" : "ddbe26a0-9504-492d-b4f2-f5acf7052e94",
        "personType" : "LEGAL_PERSON",
        "tradeName" : "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
        "salutation" : null,
        "title" : null,
        "givenName" : "Peter",
        "familyName" : "Smith"
      },
      "type" : "PARTNER",
      "mark" : null,
      "contact" : {
        "uuid" : "89d7987a-6f0b-459e-afd9-a8bf81ec2048",
        "caption" : "second contact",
        "postalAddress" : {
          "country" : "Germany"
        },
        "emailAddresses" : {
          "main" : "contact-admin@secondcontact.example.com"
        },
        "phoneNumbers" : {
          "phone_office" : "+49 123 1234567"
        }
      }
    },
    "details" : {
      "uuid" : "57781e0c-3ce2-42b6-a281-044de4f6e92a",
      "registrationOffice" : "Hamburg",
      "registrationNumber" : "RegNo123456789",
      "birthName" : null,
      "birthPlace" : null,
      "birthday" : null,
      "dateOfDeath" : null
    }
  },
  "mainDebitor" : null,
  "memberNumber" : "M-1000202",
  "memberNumberSuffix" : "02",
  "validFrom" : "2022-10-01",
  "validTo" : "2025-12-31",
  "status" : "CANCELLED",
  "membershipFeeBillable" : true
} ]

generated on 2026-08-10 01:37:48 for branch